package com.jintian.smart.base.expression.config;

import com.jintian.smart.base.expression.expr.function.RequestContextFn;
import com.jintian.smart.base.expression.fn.*;
import com.jintian.smart.kernel.core.orm.IBizTableLoader;
import com.jintian.smart.kernel.orm.service.DefaultBizTableLoader;
import org.beetl.core.Function;
import org.springframework.context.annotation.Bean;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Order(1)
@Component
public class OrmExpressionConfig {
    @Bean
    Function hasRoleFunction() {
        return new HasRoleFunction();
    }

    @Bean
    Function userInfoFunction() {
        return new UserInfoFunction();
    }

    @Bean
    Function loginIdFunction() {
        return new LoginIdFunction();
    }

    @Bean
    Function loginNameFunction() {
        return new LoginNameFunction();
    }

    @Bean
    Function childAreaConditionFunction() {
        return new ChildAreaConditionFunction();
    }

    @Bean
    RequestContextFn requestContextFn() {
        return new RequestContextFn();
    }

    @Bean
    IBizTableLoader bizTableLoader() {
        return new DefaultBizTableLoader();
    }
}
